const api = require('../../api/api.js');
const app = getApp();

Page({
  data: {
    videos: []
  },
  onLoad(o) {
    let siteId = o.siteid;
    console.log(siteId);
    this.setData({
      siteId: siteId
    });
    this.querySiteVideo();
  },
  querySiteVideo() {
    let that = this;
    let siteId = that.data.siteId;
    api.querySiteVideo({
      data: {
        siteId
      },
      success(res) {
        console.log(res.data);
        let videos = res.data.siteVideo;
        that.setData({
          videos,
        });
      }
    });
  }
})